﻿using System;
using System.Collections.Generic;
using System.Text;
using Common;

namespace LoginServer
{
    public partial class ManagerMachine
    {
        public void SendMessage_L_CreateRoom(int UserID, int RoomID, string RoomName)
        {
            List<byte> tmp = new List<byte>();
            tmp.AddRange(BitConverter.GetBytes(UserID));
            tmp.AddRange(BitConverter.GetBytes(RoomID));
            byte[] data = Encoding.UTF8.GetBytes(RoomName);
            tmp.AddRange(data);
            connection.SendMessage(MSG_GSM.L_CreateRoom, tmp.ToArray());
        }
        public void SendMessage_L_JoinRoom(int UserIDJoin, int RoomID)
        {
            List<byte> tmp = new List<byte>();
            tmp.AddRange(BitConverter.GetBytes(UserIDJoin));
            tmp.AddRange(BitConverter.GetBytes(RoomID));
            connection.SendMessage(MSG_GSM.L_JoinRoom, tmp.ToArray());
        }
        public void SendMessage_L_CreateTable(int UserID,int TableID)
        {
            List<byte> tmp = new List<byte>();
            tmp.AddRange(BitConverter.GetBytes(UserID));
            tmp.AddRange(BitConverter.GetBytes(TableID));
            connection.SendMessage(MSG_GSM.L_CreateTable,tmp.ToArray());
        }
        public void SendMessage_L_JoinTable(int UserIDJoin, int TableID)
        {
            List<byte> tmp = new List<byte>();
            tmp.AddRange(BitConverter.GetBytes(UserIDJoin));
            tmp.AddRange(BitConverter.GetBytes(TableID));
            connection.SendMessage(MSG_GSM.L_JoinTable, tmp.ToArray());
        }
        public void SendMessage_L_OutTable(int UserIDOut, int TableID)
        {
            List<byte> tmp = new List<byte>();
            tmp.AddRange(BitConverter.GetBytes(UserIDOut));
            tmp.AddRange(BitConverter.GetBytes(TableID));
            connection.SendMessage(MSG_GSM.L_OutTable, tmp.ToArray());
        }
        public void SendMessage_L_Remove_Table(int TableID)
        {
            List<byte> tmp = new List<byte>();  
            tmp.AddRange(BitConverter.GetBytes(TableID));
            connection.SendMessage(MSG_GSM.L_Remove_Table, tmp.ToArray());
        }


    }
}
